var http = require('../http.js')

// 首页统计数据
const statistic = () => {
  var url = 'Coupon/index'
  return http.getReq(url)
}
// 获取类别
// shop：商户类别 info: 咨询 circle：动态类别
const category = (type) => {
  var url = 'common/category'
  return http.getReq(url, {
    type: type
  })
}

//动态列表 页码、类型、经度、纬度、用户id  获取某一类的动态

const list = (pn, longitude, latitude, cat_id) => {
  var url = 'coupon/list'
  if (pn > 1) {
    http.config.isload = false
  }

  var data = {}

  data = Object.assign(data, {
    pn: pn,
    longitude: longitude,
    latitude: latitude,
    cat_id: cat_id
  })
  return http.getReq(url, data)
}
// 商品列表goods/list
const goods_list = (data) => {
  var url = 'goods/list'
  return http.getReq(url, data)
}
module.exports = {
  statistic,
  category,
  list,
  goods_list,
}